package com.xxjz.sc.controller.study.bean;

public class Animal {
    public String name;
    public String sayWhat;
    private int age;
    protected int hungry;

    public Animal() {
        this.name = "小动物";
        this.sayWhat = "嘤嘤嘤";
        this.age = 1;
        this.hungry = 2;
    }

    public Animal(String name, String sayWhat, int age, int hungry) {
        this.name = name;
        this.sayWhat = sayWhat;
        this.age = age;
        this.hungry = hungry;
    }

    public String say(String say){
        return "我是一只"+name+",我的叫声是:"+say;
    }
    
    private void eat(){
        hungry ++;
    }

    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                ", sayWhat='" + sayWhat + '\'' +
                ", age=" + age +
                ", hungry=" + hungry +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSayWhat() {
        return sayWhat;
    }

    public void setSayWhat(String sayWhat) {
        this.sayWhat = sayWhat;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getHungry() {
        return hungry;
    }

    public void setHungry(int hungry) {
        this.hungry = hungry;
    }
}
